import request from '@/utils/request'
/**
 * 文章列表
 */
export function getAritcleListApi(obj) {
  return request({
    url: '/articles',
    method: 'get',
    params: obj
  })
}
/**
 * 文章添加
 */
export function addAritcleListApi(data) {
  return request({
    url: '/articles',
    method: 'POST',
    data
  })
}
/**
 * 文章详情
 */

export function getAritcleDetailApi(id) {
  return request({
    url: `/articles/${id}`,
    method: 'get'
  })
}
/**
 * 文章编辑
 */
export function editAritcleDetailApi(id, data) {
  return request({
    url: `/articles/${id}`,
    method: 'put',
    data
  })
}
/**
 * 文章删除
 */
export function delAritcleApi(id) {
  return request({
    url: `/articles/${id}`,
    method: 'delete'
  })
}

/**
 * 文章状态修改
 */
export function updateAritcleStateApi(id, state) {
  return request({
    url: `/articles/${id}/${state}`,
    method: 'POST'
  })
}
